package 力扣日常刷题.木22一月.第09天0117;

/**
 * @author 帅小伙
 * @date 2022/1/17
 * @description
 * 背包问题
 */
public class Demo12动态规划中等零钱兑换2 {


    public int change(int amount, int[] coins) {
        int[] dp = new int[amount+1];

        dp[0] = 1;
        for (int coin : coins) {
            for (int i = coin; i <= amount ; i++) {
                dp[i] += dp[i-coin];
            }
        }
        return dp[amount];
    }
}
